package com.bw.day_2.login

import androidx.lifecycle.MutableLiveData
import com.alibaba.android.arouter.facade.annotation.Route
import com.bw.base.entity.RegisterEntity
import com.bw.base.net.ApiService
import com.bw.base.entity.UserEntity
import com.bw.base.mvvm.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class LoginViewModel @Inject constructor(val apiService: ApiService): BaseViewModel() {
    var loginSuccess = MutableLiveData<UserEntity>()
    fun login(name:String,pwd:String){
        httpRequest({ apiService.login(name, pwd) },{loginSuccess.value = it})
    }


}